package com.sun.framework.config;

import cn.hutool.core.io.FileUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.List;

import static com.sun.common.constants.Constant.SSQ_FILE_PATH;
import static com.sun.common.utils.SsqDataUtil.generateAllRedCombinations;

@Slf4j
@Configuration
public class SsqDataConfig {

    // 初始化所有中奖数据
    @Bean("ssqData")
    public List<String> initWinningData() {
        return FileUtil.readUtf8Lines(SSQ_FILE_PATH);
    }

    // 初始化所有红球组合数据
    @Bean("allRedCombinations")
    public List<List<Integer>> initAllRedCombinations() {
        List<List<Integer>> allRedCombinations = generateAllRedCombinations();
        return generateAllRedCombinations();
    }

}
